<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>详细 - 手机客户端</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/jquery.global.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		var $loadAjax = new $.LoadAjax({
			renderTarget : ".wrap #appList ul",
			fn : function(obj,data,mask){
					var info = data.list;
					var appDetailContent = data.sampMsg==null?"暂时没有应用介绍！":data.sampMsg.content;
					//alert($(".wrap article header dl dd:first-child>img").attr("src"));
					$(".wrap article header dl dd:first-child>img").attr("src",requestPicPath+info[0].picPath).removeAttr("style").parent().next().html("<strong>"+info[0].name+"</strong>"+(info[0].company==null?'':'<span>'+info[0].company+"</span>")+"<span>"+(info[0].appVersion==null?'':'版本:'+info[0].appVersion+"</span>")+"<span>大小："+info[0].size+"MB</span>").next().find("button").after(info[0].downloadTimes+"次").parents("header").next().html(appDetailContent);
					name = info[0].name;
					icon = requestPicPath+info[0].picPath;
					url = data.url;
					if(info.length==1){
						$(mask).remove();
						$(".wrap article section:last-child dl").hide();
						return;
					}else{
						for(var i=1;i<info.length;i++){
							$(".wrap article section:last-child dl").append('<dd data-appId="'+info[i].appId+'" data-id="'+info[i].id+'"><img src="'+requestPicPath+info[i].picPath+'" /><span>'+info[i].name+'</span></dd>');
						}
					}
			},
			url : requestPath+"/websamp/pubapi/mobile/selectTemplate?appId="+getUrlParam("appId")+"&id="+getUrlParam("id"),
			pageSize : 12,
			picPath : requestPicPath
		});
		$loadAjax.init();
		$loadAjax.loadAppList();
		
		var $switchover = new $.Switchover({
			obj : ".wrap article section:last-child dl dd",
			fn : function(obj){
				obj.css("background","#efefef").siblings().css("background","none");
				window.location.href = "detail.html?appId="+obj.attr("data-appId")+"&id="+obj.attr("data-id");
			}
		}).init();
		
		$(".wrap footer button:first-child").click(function(){
			//history.go(-1);// cancel
			window.proxy.cancel();
		});
		
		new $.Download({
			obj : ".wrap header dl dd button,.wrap footer button:last-child",
		}).init();
	});
</script>
</head>
<body>
<div class="wrap"> 
  <!--  <header>
    <nav>
      <button onClick="javascript:history.go(-1)"></button>
    </nav>
  </header>-->
  <article>
    <header>
      <dl>
        <dd><img src="images/loading.gif" style="width:20px;" /></dd>
        <dt></dt>
        <dd>
          <button>免费下载</button>
        </dd>
      </dl>
    </header>
    <section></section>
    <section>
      <dl>
        <dt>相关应用</dt>
      </dl>
    </section>
  </article>
  <footer>
    <button>取消</button>
    <button>下载</button>
  </footer>
</div>
</body>
</html>